<?php
   require_once('system/dbConnect.php');
   require_once('system/MyFunc.php');   
   connect();
  $sql = "select uid, uname, gender, birthdate, hobby, degree, intro, pic from users";
      if($_POST)
  {
    $key = $_POST['key'];
    $sql = $sql." where uname like '%{$key}%' ";
  }
  $result = fetch_array($sql);    
 ?>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>用户编号</th>
   <th>用户名</th>   
   <th>性别</th>
   <th>生日</th>
   <th>爱好</th>
   <th>学历</th>
   <th>自我介绍</th> 
   <th width='80'>头像</th>
   <th>操作</th>
 </tr>
<?php
  foreach ($result as $row) {
   echo '<tr>';
   echo '<td>'.$row['uid'].'</td>';
   echo '<td>'.$row['uname'].'</td>';  
   echo '<td>'.$row['gender'].'</td>';
   echo '<td>'.$row['birthdate'].'</td>';
   echo '<td>'.$row['hobby'].'</td>';
   echo '<td>'.$row['degree'].'</td>';
   echo '<td>'.$row['intro'].'</td>';    
   echo '<td align="center"><img src='.$row['pic'].' width=60 height=80 alt="无头像"></td>';
   echo '<td><a href="userList.php?id='.$row['uid'].' ">返回</a></td>';  
  }
  echo '</table>';  
?>